package com.example.personnel_oa.dubbo;

import com.example.comment_oa.dubbo.SysEmployeeServiceDubbo;
import com.example.comment_oa.pojos.SysDept;
import com.example.comment_oa.pojos.SysEmployee;
import com.example.comment_oa.pojos_vo.HySysEmpVo;
import com.example.personnel_oa.mapper.SysEmployeeMapper;
import com.example.personnel_oa.service.SysEmployeeService;
import org.apache.dubbo.config.annotation.DubboService;

import javax.annotation.Resource;
import java.util.List;

@DubboService(version = "1.0.0",protocol = "${dubbo.protocol.id}",
        application = "${dubbo.application.id}",registry = "${dubbo.registry.id}",
        timeout = 3000)
public class SysEmployeeDubboImpl implements SysEmployeeServiceDubbo {
    @Resource
    SysEmployeeService employeeService;
    @Override


    //根据id查询员工信息部门职位
    public SysEmployee selectEmpId(int empId) {
        SysEmployee sysEmployee = employeeService.selectEmpId(empId);
        return sysEmployee;
    }

    //查询出全部员工不包含懂事长部门
    @Override
    public List<SysEmployee> selectEmp() {
        List<SysEmployee> sysEmployees = employeeService.selectEmp();
        return sysEmployees;
    }

    //条件查询（部门id,职位id，性别，政治面貌，婚姻，实习/正式）
    @Override
    public List<SysEmployee> selectEmpPostDept(HySysEmpVo sysEmpVo) {
        List<SysEmployee> sysEmployees = employeeService.selectEmpPostDept(sysEmpVo);
        return sysEmployees;
    }

    //根据员工id修改员工工资
    @Override
    public int updateSalary(int empSalary, int empId) {
        int i = employeeService.updateSalary(empSalary, empId);
        return i;
    }
    //根据部门id查询员工
    @Override
    public List<SysEmployee> depidtEmp(int deptId) {
        List<SysEmployee> sysEmployees = employeeService.depidtEmp(deptId);
        return sysEmployees;
    }

    //根据工号查询员工上级信息
    @Override
    public SysEmployee gonghao(String empCard) {
        SysEmployee gonghao = employeeService.gonghao(empCard);
        return gonghao;
    }

    //根据工号查询全部员工信息(部门，岗位)
    @Override
    public SysEmployee empCard_empId(String empCard) {
        SysEmployee sysEmployee = employeeService.empCard_empId(empCard);
        return sysEmployee;
    }

    //查询在职，离职工资未结清的人员
    @Override
    public List<SysEmployee> empis() {
        List<SysEmployee> empis = employeeService.empis();
        return empis;
    }

    //根据员工工号查询员工
    @Override
    public SysEmployee empCardID(String empCard) {
        SysEmployee sysEmployee = employeeService.empCardID(empCard);
        return sysEmployee;
    }

}
